package com.snow.datasource.provider;

import com.snow.datasource.properties.DataSourceProperty;
import lombok.AllArgsConstructor;

import javax.sql.DataSource;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 *  雪花多数据源建造者
 *
 * @Description
 * @Author fanxl 315620726@qq.com
 * @Date 2020/12/16
 **/
@AllArgsConstructor
public class SnowDataSourceProvider extends AbstractSnowProvider {
    /**
     * 所有数据源配置加载
     */
    private final ConcurrentHashMap<String, DataSourceProperty> dataSourcePropertiesMap;

    @Override
    public Map<String, DataSource> loadDataSources(){
        return this.createDataSources(dataSourcePropertiesMap);
    }

}
